<%@page import="entities.Page"%>
<%@page import="java.util.TreeMap"%>
<%@page import="helpers.UrlHelper"%>
<%
TreeMap check = (TreeMap) request.getAttribute("check");
Page static_page = (Page) request.getAttribute("page");
String title = (String) request.getAttribute("title");
%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<jsp:include page="/admin/layouts/header.jsp" />

<script type="text/javascript" src="/admin/plugins/forms/tiny_mce/jquery.tinymce.js"></script>
<script type="text/javascript" src="/admin/js/custom/static_page.js"></script>

				<jsp:include page="/admin/elements/heading_panel.jsp" />

                <!-- Build page from here: -->
                <div class="row-fluid">
					<div class="span12">
						<jsp:include page="/admin/elements/message_box.jsp" />
					
                    	<div class="box">
                        	<div class="title">
                            	<h4> 
                                	<span><%=title %></span>
                            	</h4>
							</div>
	                        <div class="content">
	                        	<form class="form-horizontal" method="post">       
	                                <div class="form-row row-fluid">
	                                	<div class="span12">
	                                    	<div class="row-fluid">
	                                        	<label class="form-label span3" for="normal">Title</label>
	                                            <input type="text" name="title" class="span9 <%=check.get("title") != null ? "error" : "" %>" value="<%=static_page.getTitle()%>" />
	                                            <% if (check.get("title") != null) { %>
	                                            <label class="error" for="required" generated="true"><%=check.get("title") %></label>
	                                            <% } %>
											</div>
										</div>
									</div>
									
									<div class="form-row row-fluid">
	                                	<div class="span12">
	                                    	<div class="row-fluid">
	                                        	<label class="form-label span3" for="normal">Content</label>
	                                        	<div class="controls-textarea span9">
		                                            <textarea name="content" class="span12 tinymce <%=check.get("content") != null ? "error" : "" %>" rows="20"><%=static_page.getContent() %></textarea>
		                                            <% if (check.get("content") != null) { %>
		                                            <label class="error" for="required" generated="true"><%=check.get("content") %></label>
		                                            <% } %>
		                                        </div>
											</div>
										</div>
									</div>
									
									<div class="form-actions">
	                                	<button type="submit" class="btn btn-info">Save</button>
	                                    <button type="reset" class="btn">Reset</button>
									</div>                                           
	                    		</form>
							</div>
						</div><!-- End .box -->

					</div><!-- End .span6 -->

				</div><!-- End .row-fluid -->
                
<jsp:include page="/admin/layouts/footer.jsp" />